package org.jason.feign.user;

import org.jason.model.common.dtos.ResponseResult;
import org.jason.model.user.pojos.CuUser;
import org.jason.model.user.pojos.UserRolePermission;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(value = "coder-user")
public interface UserClient {
    /**
     * 根据用户id返回用户权限表
     *
     * @param userId 用户id
     * @return 用户权限模型
     */
    @GetMapping("/auth/{userId}")
    ResponseResult<UserRolePermission> getUserRolePerm(@PathVariable Integer userId);

    /**
     * 根据id获取用户信息
     *
     * @param userId
     * @return
     */
    @GetMapping("/user/info/{userId:\\d+}")
    ResponseResult<CuUser> getUserInfo(@PathVariable Integer userId);

    @GetMapping("/user/table")
    List<CuUser> getUserTable();
}
